package com.loong.nnm.controller;

import com.loong.nnm.entity.alarm.Alarm;
import com.loong.nnm.entity.alarm.AlarmMaskState;
import com.loong.nnm.entity.alarm.TcaParameter;
import com.loong.nnm.services.AlarmsServices;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class AlarmController {

    @Resource
    private AlarmsServices alarmsServices;

    @RequestMapping("/node/{node}/alarm/mask")
    public String setAlarmMaskState(@PathVariable String node, @RequestBody AlarmMaskState alarmMaskState) {
        return alarmsServices.setAlarmMaskState(node, alarmMaskState);
    }

    @GetMapping("/node/{node}/alarms")
    public String getAlarms(@PathVariable String node) {
        System.out.println(node);
        return alarmsServices.getAlarms(node);
    }

    @GetMapping("/node/{node}/alarms/masks")
    public String getAlarmMasks(@PathVariable String node) {
        System.out.println(node);
        return alarmsServices.getAlarmMaskState(node);
    }

    @GetMapping("/node/{node}/tcas")
    public String getTcas(@PathVariable String node) {
        System.out.println(node);
        return alarmsServices.getTca(node);
    }

    @GetMapping("/node/{node}/tcas/parameters")
    public String getTcaParameters(@PathVariable String node) {
        System.out.println(node);
        return alarmsServices.getTcaParameters(node);
    }


}
